package com.dragon.english_practice_back.mapper;

import com.dragon.english_practice_back.entity.WordBook;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.MapKey;

import java.util.List;
import java.util.Map;

/**
* @author 伫倚
* @description 针对表【word_book(单词书)】的数据库操作Mapper
* @createDate 2025-04-13 14:55:44
* @Entity com.example.english_practice_back.entity.WordBook
*/
public interface WordBookMapper extends BaseMapper<WordBook> {

    List<WordBook> getLearningWordBook(Integer userId);

    List<WordBook> getLearnedWordBook(Integer userId);

    @MapKey("id")
    List<Map<String, Boolean>> checkWordBookStatus(Integer userId, Integer bookId);

    // 学习某本书
    int learnWordBook(Integer userId, Integer bookId);
    // 取消学习某本书
    int unlearnWordBook(Integer userId, Integer bookId);
    // 删除学习记录
    int deleteLearningRecord(Integer userId, Integer bookId);
    // 取消除某本书外的所有学习状态
    int cancelLearningStatus(Integer userId, Integer ignoreBookId);
    // 取消所有书的学习状态
    int cancelAllLearningStatus(Integer userId);
}




